from flask import Flask
from flask_cors import CORS
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager
import setting
from models import *
from views import api_db

app = Flask(__name__)
CORS(app, supports_credentials=True)
app.config.from_object(setting.DevelopmentConfig)
db.init_app(app=app)
app.register_blueprint(api_db)
manage = Manager(app=app)
migrate = Migrate(app=app, db=db)
manage.add_command('db', MigrateCommand)

if __name__ == '__main__':
    app.run()
